package com.shop2cn.iapi.sqoptrade.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*删除订单Call
*FreeMaker Template自动生成代码
*/
public class MarkOrderDeletedCall extends YmatouBaseCall {
	private static String opurl = "api/Buyer/markOrderDeleted";

	public MarkOrderDeletedCall() {
		super(EnvSetup.getSystemUrl("operate2_iapi"), opurl, "POST", "JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept",
				"text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	/**
	 * 获取Success
	 * 
	 * @return
	 */
	public Boolean getSuccess() {
		Boolean Success = null;
		try {
			Success = new JSONObject(getReturnData()).getBoolean("success");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Success;
	}

	/**
	 * 获取errorMessage
	 * 
	 * @return
	 */
	public String getErrorMessage() {
		String errorMessage = null;
		try {
			errorMessage = new JSONObject(getReturnData())
					.getString("errorMessage");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return errorMessage;
	}
}